import React,{Component} from 'react';
import actions from '../../store/actions/session';
import {Redirect} from 'react-router-dom';
import {connect} from 'react-redux';
class Profile extends Component{
	render() {
		return this.props.user? (
			<div className="row">
				<div className="col-md-12">
					{this.props.user.username}
				</div>
			</div>
		):<Redirect to="/login"/>;
	}
}
export default connect(
	state => state.session,
	actions
)(Profile)